import { axios } from '@/utils/request'

const api = {
  getShareUser: '/share/list',
  moneySetting: '/share/money-setting',
  basicSetting: '/share/basic-setting',
  getSetting: '/share/get-share-setting',
  setSellerComments: '/share/seller-comments',
  shareStatus: '/share/status',
  delShareUser: '/share/del',
  getCashList: '/share/cash',
  cashApply: '/share/apply',
  cashConfirm: '/share/confirm',
  orderList: '/share/order',
  getQrcode: '/share/get-qrcode',
  qrcode: '/share/qrcode',
  getQrcodeSetting: '/share/get-qrcode-setting',
  getDetail: '/share/detail',
  getOrder: '/share/share-order',
  getCash: 'share/user-cash',
  detailSetComments: 'share/set-share-seller',
  addShare: 'share/add-share',
}

export default api

export function shareUserList(parameter) {
  return axios({
    url: api.getShareUser,
    method: 'get',
    params: parameter,
  })
}

export function setMoneySetting(parameter) {
  return axios({
    url: api.moneySetting,
    method: 'post',
    data: parameter,
  })
}

export function getShareSetting(parameter) {
  return axios({
    url: api.getSetting,
    method: 'get',
    params: parameter,
  })
}

export function setBasicSetting(parameter) {
  return axios({
    url: api.basicSetting,
    method: 'post',
    data: parameter,
  })
}

export function setComments(parameter) {
  return axios({
    url: api.setSellerComments,
    method: 'post',
    data: parameter,
  })
}

export function setAudit(parameter) {
  return axios({
    url: api.shareStatus,
    method: 'post',
    data: parameter,
  })
}

export function setDel(parameter) {
  return axios({
    url: api.delShareUser,
    method: 'post',
    data: parameter,
  })
}

export function cashList(parameter) {
  return axios({
    url: api.getCashList,
    method: 'get',
    params: parameter,
  })
}

export function applyAudit(parameter) {
  return axios({
    url: api.cashApply,
    method: 'post',
    data: parameter,
  })
}

export function applyConfirm(parameter) {
  return axios({
    url: api.cashConfirm,
    method: 'post',
    data: parameter,
  })
}

export function getOrderList(parameter) {
  return axios({
    url: api.orderList,
    method: 'get',
    params: parameter,
  })
}

export function getQrcode(parameter) {
  return axios({
    url: api.getQrcode,
    method: 'get',
    params: parameter,
  })
}

export function qrcode(parameter) {
  return axios({
    url: api.qrcode,
    method: 'post',
    data: parameter,
  })
}

export function getQrcodeSetting(parameter) {
  return axios({
    url: api.getQrcodeSetting,
    method: 'get',
    params: parameter,
  })
}

export function getDetail(parameter) {
  return axios({
    url: api.getDetail,
    method: 'post',
    data: parameter,
  })
}

export function getOrder(parameter) {
  return axios({
    url: api.getOrder,
    method: 'get',
    params: parameter,
  })
}

export function getCash(parameter) {
  return axios({
    url: api.getCash,
    method: 'get',
    params: parameter,
  })
}

export function detailSetComments(parameter) {
  return axios({
    url: api.detailSetComments,
    method: 'post',
    data: parameter,
  })
}

export function addShare(parameter) {
  return axios({
    url: api.addShare,
    method: 'post',
    data: parameter,
  })
}

export function shareLevelList(params) {
  return axios({
    url: '/share-level/share-level-list',
    method: 'get',
    params,
  })
}

export function shareLevelStatus(data) {
  return axios({
    url: '/share-level/share-level-status',
    method: 'post',
    data,
  })
}

export function shareLevelSave(data) {
  return axios({
    url: '/share-level/share-level-save',
    method: 'post',
    data,
  })
}

export function setShareLevel(data) {
  return axios({
    url: '/share/set-share-level',
    method: 'post',
    data,
  })
}
